package engine.newUi
{
	import engine.control.loading.MultLoader;
	import engine.data.ResPath;
	import engine.ui.lite.BaseUI;
	
	import flash.display.MovieClip;
	
	import newx.StageInfo;
	import newx.com.config.StaticIni;
	import newx.com.control.NxClip;
	import newx.com.control.button.NxButton;
	import newx.com.control.group.NxViewGroup;
	import newx.com.control.text.NxText;

	public class ChristmastimeUI extends BaseUI
	{
		public static var _self:ChristmastimeUI ; 
		public static function getInstance():ChristmastimeUI
		{
			if(_self==null)
			{
				_self = new ChristmastimeUI();
			}
			return _self  ;
		}
		public var itemGroup:NxViewGroup; 
		public var ImaBG:NxClip ; 
		public var nameMC:MovieClip ; 
		public var closeBtn:NxButton ; 
		public function ChristmastimeUI()
		{
			
		}
		override public function Init():void
		{
			ChristmastimeLogic.getinstence().init();
			for(var i:int = 0; i <itemGroup.col*itemGroup.row ;i++)
			{
				var mc:MovieClip = itemGroup.getItemByIndex(i) ; 
				mc.visible = false ; 
			}
		}
		override protected function BeforeShow():void
		{
			if(!MultLoader.getInstance().getSourceByUrl(ResPath.SWF + "ChristmastimeUI.swf"))
			{
				MultLoader.getInstance().load([ResPath.SWF + "ChristmastimeUI.swf"],true,createScene);
			}else
			{
				createScene();
			}
			
		}
		private function createScene():void
		{
			nameMC  =  MultLoader.getInstance().getSourceByUrl(StageInfo.swfResPath + "ChristmastimeUI.swf") ;
			ImaBG.source = nameMC ; 
			
			ChristmastimeLogic.getinstence().BeforeShow();
		}
		override protected function AfterHide():void
		{
			nameMC = null ; 
			ImaBG.source =null ; 
			ChristmastimeLogic.getinstence().AfterHide(); 
		}
	}
}